// 储存订单页面数据

export default {
  namespaced: true,
  state: {
    // 总价格
    totalPrice: 0,
    // 进行中的订单
    progress: {},
    // 历史订单
    history: [],
  },
  mutations: {
    // 改变总价格
    changeTotalPrice(state,payload) {
      state.totalPrice = payload
    },
    // 改变progress中的数据
    changeProgress (state,payload) {
      state.progress = payload
    },
    // 改变progress中的finish状态
    changeProgressFinish(state,payload) {
      state.progress.finish = payload
      console.log(payload);
    },

    // 添加历史订单
    pushHistory (state,payload) {
      state.history.push(payload)
    }
  },
}